3.235 \(\int \cot (c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx\)

Optimal. Leaf size=37 \[ x (a B+A b)+\frac{a A \log (\sin (c+d x))}{d}-\frac{b B \log (\cos (c+d x))}{d} \]

[Out]

(A*b + a*B)*x - (b*B*Log[Cos[c + d*x]])/d + (a*A*Log[Sin[c + d*x]])/d

________________________________________________________________________________________

Rubi [A]  time = 0.0687638, antiderivative size = 37, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.111, Rules used = {3589, 3475, 3531} \[ x (a B+A b)+\frac{a A \log (\sin (c+d x))}{d}-\frac{b B \log (\cos (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]*(a + b*Tan[c + d*x])*(A + B*Tan[c + d*x]),x]

[Out]

(A*b + a*B)*x - (b*B*Log[Cos[c + d*x]])/d + (a*A*Log[Sin[c + d*x]])/d

Rule 3589

Int[(((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]))/((a_.) + (b_.)*tan[(e_.)
 + (f_.)*(x_)]), x_Symbol] :> Dist[(B*d)/b, Int[Tan[e + f*x], x], x] + Dist[1/b, Int[Simp[A*b*c + (A*b*d + B*(
b*c - a*d))*Tan[e + f*x], x]/(a + b*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a
*d, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3531

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((a*c +
 b*d)*x)/(a^2 + b^2), x] + Dist[(b*c - a*d)/(a^2 + b^2), Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x]
 /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[a*c + b*d, 0]

Rubi steps

\begin{align*} \int \cot (c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx &=(b B) \int \tan (c+d x) \, dx+\int \cot (c+d x) (a A+(A b+a B) \tan (c+d x)) \, dx\\ &=(A b+a B) x-\frac{b B \log (\cos (c+d x))}{d}+(a A) \int \cot (c+d x) \, dx\\ &=(A b+a B) x-\frac{b B \log (\cos (c+d x))}{d}+\frac{a A \log (\sin (c+d x))}{d}\\ \end{align*}

Mathematica [A]  time = 0.0720034, size = 44, normalized size = 1.19 \[ \frac{a A (\log (\tan (c+d x))+\log (\cos (c+d x)))}{d}+a B x+A b x-\frac{b B \log (\cos (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[c + d*x]*(a + b*Tan[c + d*x])*(A + B*Tan[c + d*x]),x]

[Out]

A*b*x + a*B*x - (b*B*Log[Cos[c + d*x]])/d + (a*A*(Log[Cos[c + d*x]] + Log[Tan[c + d*x]]))/d

________________________________________________________________________________________

Maple [A]  time = 0.056, size = 51, normalized size = 1.4 \begin{align*} Axb+aBx+{\frac{Aa\ln \left ( \sin \left ( dx+c \right ) \right ) }{d}}+{\frac{Abc}{d}}-{\frac{Bb\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}+{\frac{Bac}{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)*(a+b*tan(d*x+c))*(A+B*tan(d*x+c)),x)

[Out]

A*x*b+a*B*x+a*A*ln(sin(d*x+c))/d+1/d*A*b*c-b*B*ln(cos(d*x+c))/d+1/d*B*a*c

________________________________________________________________________________________

Maxima [A]  time = 1.49574, size = 70, normalized size = 1.89 \begin{align*} \frac{2 \, A a \log \left (\tan \left (d x + c\right )\right ) + 2 \,{\left (B a + A b\right )}{\left (d x + c\right )} -{\left (A a - B b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+b*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="maxima")

[Out]

1/2*(2*A*a*log(tan(d*x + c)) + 2*(B*a + A*b)*(d*x + c) - (A*a - B*b)*log(tan(d*x + c)^2 + 1))/d

________________________________________________________________________________________

Fricas [A]  time = 2.02036, size = 146, normalized size = 3.95 \begin{align*} \frac{2 \,{\left (B a + A b\right )} d x + A a \log \left (\frac{\tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) - B b \log \left (\frac{1}{\tan \left (d x + c\right )^{2} + 1}\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+b*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(2*(B*a + A*b)*d*x + A*a*log(tan(d*x + c)^2/(tan(d*x + c)^2 + 1)) - B*b*log(1/(tan(d*x + c)^2 + 1)))/d

________________________________________________________________________________________

Sympy [A]  time = 0.671062, size = 78, normalized size = 2.11 \begin{align*} \begin{cases} - \frac{A a \log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac{A a \log{\left (\tan{\left (c + d x \right )} \right )}}{d} + A b x + B a x + \frac{B b \log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} & \text{for}\: d \neq 0 \\x \left (A + B \tan{\left (c \right )}\right ) \left (a + b \tan{\left (c \right )}\right ) \cot{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+b*tan(d*x+c))*(A+B*tan(d*x+c)),x)

[Out]

Piecewise((-A*a*log(tan(c + d*x)**2 + 1)/(2*d) + A*a*log(tan(c + d*x))/d + A*b*x + B*a*x + B*b*log(tan(c + d*x
)**2 + 1)/(2*d), Ne(d, 0)), (x*(A + B*tan(c))*(a + b*tan(c))*cot(c), True))

________________________________________________________________________________________

Giac [A]  time = 1.17955, size = 72, normalized size = 1.95 \begin{align*} \frac{2 \, A a \log \left ({\left | \tan \left (d x + c\right ) \right |}\right ) + 2 \,{\left (B a + A b\right )}{\left (d x + c\right )} -{\left (A a - B b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+b*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="giac")

[Out]

1/2*(2*A*a*log(abs(tan(d*x + c))) + 2*(B*a + A*b)*(d*x + c) - (A*a - B*b)*log(tan(d*x + c)^2 + 1))/d